<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>    

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script>
	 function joinFn()
	{
		var title1  = "testpop1";
		var status = "toolbar=no,directories=no,scrollbars=no,resizable=no,status=no,menubar=no,width=1000, height=400, top=0,left=20"; 
		window.open("EMP1010P1.do", title1,status);
	} 
	function searchAll()
	{
		var frm=document.frm01;
		frm.action = "EMP1010M1.do";
		frm.submit();
	}
	
	function search1()
	{
		var frm=document.frm01;
	/* 	
		var year1=frm.year1.value;
		var month1=frm.month1.value;
		var day1=frm.day1.value;
		var year2=frm.year2.value;
		var month2=frm.month2.value;
		var day2=frm.day2.value;
		var sYear1=0;
		var sMonth1=0;
		var sDay1=0;
		var sYear2=0;
		var sMonth2=0;
		var sDay2=0;
		var lastDay=0;;
		
		
		if(year1!="yearDefault1"){
			sYear1=parseInt(year1);
		}
		if(month1!="monthDefault1"){
			sMonth1=parseInt(frm.month1.value.replace(/(^\s*)|(\s*$)/gi, ""));
		}
		if(day1!="dayDefault1"){
			sDay1=parseInt(frm.day1.value.replace(/(^\s*)|(\s*$)/gi, ""));
		}
		if(year2!="yearDefault2"){
			sYear2=parseInt(year2);
		}
		if(month2!="monthDefault2"){
			sMonth2=parseInt(frm.month2.value.replace(/(^\s*)|(\s*$)/gi, ""));
		}
		if(day2!="dayDefault2"){
			sDay2=parseInt(frm.day2.value.replace(/(^\s*)|(\s*$)/gi, ""));
		}
		
		
		if(sYear1>0 && year2=='yearDefault2'){
			sYear2=2014;
		}
		
		if(sYear2>0 && year1=='yearDefault1'){
			sYear1=1900;
		} 
		
		if(year1=='yearDefault1' && (month1!='monthDefault1' || day1 !='dayDefault1'))
		{
			alert("졸업일의 년도를 선택해 주세요");	
			return;
		}
		if(year2=='yearDefault2' && (month2!='monthDefault2' || day2!='dayDefault2'))
		{
			alert("졸업일의 년도를 선택해 주세요");
			return;
		}
		
		if(month1=='monthDefault1'&& day1!='dayDefault1'){
			alert("졸업일의 월을 선택해 주세요");
			return;
		}
		
		if(month2=='monthDefault2'&& day2!='dayDefault2'){
			alert("졸업일의 월을 선택해 주세요");
			return;
		}
		
		lastDay1 = (new Date(sYear1, sMonth1, 0)).getDate();
		lastDay2 = (new Date(sYear1, sMonth2, 0)).getDate();
		
		if(sDay1>lastDay1 ||sDay2>lastDay2){
			alert("졸업년일의 일자가 잘못 되었습니다.");
			return;
		}
		
		if(sYear1>sYear2||(sYear1==sYear2 && sMonth1>sMonth2) || (sYear1==sYear2 && sMonth1==sMonth2 && sDay1>sDay2))
		{
			alert("졸업년일의 검색 범위가 잘못 되었습니다.");
			return;
		}		
		
		
		 */
		frm.action = "EMP1010M2.do";
		frm.submit();
	}
</script>
</head>
<body>
<form name="frm01" method="post">

	<center>

		<table border="1">
			<tr>
				<td  align="center" colspan="6"> 사원 정보 검색 </td>
			</tr>
			<tr>
				<td>이  름</td>
				<td>
					<input name ="employeeName" type="text" maxlength="10" value="">
				</td>
				<td> 성  별 </td>
				<td>
					<c:forEach var="a"  items="${model}">
						<c:if test="${a.codeType=='GENDER'&& a.codeDetail!='GENDER'}">
							<input type="radio" name="genderCode" value="${a.codeDetail}"> ${a.codeName }
						</c:if>
					</c:forEach>
				</td>
				<td> 소속부서 </td>
				<td>
					<select name="departmentCode">
						<option value="deptDefault"></option>
						<c:forEach var="b"  items="${model}">
							<c:if test="${b.codeType=='DEPARTMENT'}">
								<option value="${b.codeDetail}">${b.codeName }</option>
							</c:if>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<td> 학  력 </td>
				<td>
					<c:forEach var="c"  items="${model}">
						<c:if test="${c.codeType=='GRADUATION'}">
							<input type="checkbox" name="graduationTypeCode" value="${c.codeDetail}"> ${c.codeName }
						</c:if>
					</c:forEach>
				</td>
				<td> 기  술 </td>
				<td colspan="3">
					<c:forEach var="d"  items="${model}">
						<c:if test="${d.codeType=='SKILL'}">
							<input type="checkbox" name="skillCode" value="${d.codeDetail}">${d.codeName }
						</c:if>
					</c:forEach>
				</td>
			</tr>
			<tr>
				<td>졸업일</td>
				<td colspan="5">
					<select name="year1">
						<option value="yearDefault1"> </option>
						<c:forEach var="y1" begin="1900" end="2014" step="1">
							<option value="${y1}">${y1} </option>
						</c:forEach>
					</select> 년
					<select name="month1">
						<option value="monthDefault1"></option>
						<c:forEach var="m1" begin="1" end="12" step="1">
							<option value="${m1}">${m1} </option>
						</c:forEach>
					</select> 월
					<select name="day1">
						<option value="dayDefault1"></option>
						<c:forEach var="d1" begin="1" end="31" step="1">
							<option value="${d1} ">${d1} </option>
						</c:forEach>
					</select> 일 ~ 
					<select name="year2">
						<option value="yearDefault2"> </option>
						<c:forEach var="y2" begin="1900" end="2014" step="1">
							<option value="${y2}">${y2} </option>
						</c:forEach>
					</select> 년
					<select name="month2">
						<option value="monthDefault2"></option>
						<c:forEach var="m2" begin="1" end="12" step="1">
							<option value="${m2} ">${m2} </option>
						</c:forEach>
					</select> 월
					<select name="day2">
						<option value="dayDefault2"></option>
						<c:forEach var="d2" begin="1" end="31" step="1">
							<option value="${d2}">${d2} </option>
						</c:forEach>
					</select> 일					
				</td>
			</tr>
			<tr>
				<td align="center" colspan="6">
					<input type="button" name="search" onclick="search1()" value="검색"> &nbsp; 
					<input type="button" name="searchall" onclick="searchAll()" value="전부검색"> &nbsp; 
					<input type="reset" value="초기화">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="button" name="join" onclick="joinFn()" value="등록"> 
			</tr>
		</table>
		</center>
			${msg }
</form>
	
</body>
</html>